<template>
	<div class="wraper" :class="{padTop:isIphoneX,iphone:isIphone}">
		<div class="nav-bar">
			<div class="arrow" @click="goBack"></div>
			<div class="center">兑换记录</div>
			<span></span>
		</div>
		<div class="title">
			<div class="left">券金额</div>
			<div class="center">消耗BTC数量</div>
			<div class="right">时间</div>
		</div>
		<div class="content" :class="{noDataRedHistory:(list.length==0 && finished)}">
			<van-list
				v-model="loading"
  				:finished="finished"
  				:error.sync="loadError"
  				error-text="请求失败，点击重新加载"
  				finished-text="已经全部加载完毕"
  				@load="init"
			>
				<ul v-for="item in list">
					<li class="left">{{item.coupon_amount_e2/100}}券*{{item.coupon_nums}}张</li>
					<li class="center">{{((item.btc_e8/100000000)*item.coupon_nums).toFixed(8)}}</li>
					<li class="right">{{item.create_time}}</li>
				</ul>
				<div class="empty" v-if="list.length==0 && finished">
					暂无兑换记录
				</div>
			</van-list>
		</div>
	</div>
</template>
<script src="./redExchangeHistory.js"></script>
<style scoped lang="scss">
	@import './redExchangeHistory.scss';
</style>
<style>
	.noDataRedHistory .van-list__finished-text{
		display: none;
	}
</style>